import datetime
from applications.extensions import db


class BaseModel(db.Model):
    __abstract__ = True
    __table_args__ = {
        'extend_existing': True,
        'mysql_charset': 'utf8mb4',
        'mysql_collate': 'utf8mb4_unicode_ci',
    }

    created_at = db.Column(db.DateTime, default=datetime.datetime.now)
    updated_at = db.Column(
        db.DateTime, default=datetime.datetime.now, onupdate=datetime.datetime.now)
